#include "fish.h"

Fish::Fish(const QString & fileName,QGraphicsScene *scence):QpixmapItem(fileName,scence)
{
    setPos(-100,100+qrand()%550);
}
void Fish::advance(int phase)
{
    if(mapToScene(0,0).y()<=0||mapToScene(0,0).x()>=1149)
    {
        setPos(-100+qrand()%100,100+qrand()%550);
    }
    int speed=qrand()%10;
    this->setPos(mapToScene(speed,-0.5));
}
